wd=cd;
cd ..;
%size=100;
size=1000;
velikost=num2str(size);
%file='eye';
file='copy';
%file='part';
%file='tra';
%file='norm1';
%file='norm2';
%file='normi';
%file='normf';
%file='uminus';
%file='plus';
%file='minus';
%file='rdivide'; %cpp ne
%file='ldivide'; %cpp ne
%file='multa';
%file='mult';
%file='times';
%file='inv';
%file='rank';
%file='det';
%file='lu_l';  %L*U=P*A
%file='lu_u'; %A=P\(L*U)

%file='lu_p';
    %p=Pcpp'+1;
    %n = length(p);
    %I = eye(n);
    %PERM = I(p, :);

%file='qr_q';  % M(1:size,size)=M(1:size,size)*-1 %qr_q
%file='qr_r'; %R(size,size)=R(size,size)*-1     %pro vse mimo java

%file='chol'; %M=M'

%file='svd_u'; %pro vsechny jazyky porovnat lin zavislost s JAMA
%file='svd_s';               %CPP=amatic(M,CPP);
%file='svd_v';  %pro vsechny jazyky porovnat lin zavislost s JAMA

%file='eig_rm';
%file='eig_im';
%file='eig_rv';
%file='eig_iv';



%na vektory a cisla
%M=dlmread ([file '_m' velikost '.csv'],';');
%CPP=dlmread ([file '_cpp' velikost '.csv'],';');
%CS=dlmread ([file '_cs' velikost '.csv'],';');
%J=dlmread ([file '_j' velikost '.csv'],';');

%serazeni vlastnich cisel
%CPP=sort(CPP);
%J=sort(J);
%CS=sort(CS);
%M=sort(M);

M=dlmread ([file '_m' velikost '.csv'],';');
    %M=M';   %pro Chol
    %M(1:size,size)=M(1:size,size)*-1; %qr_q
    %M(size,size)=M(size,size)*-1
    
CPP=dlmread ([file '_cpp' velikost '.csv'],';',[0 0 size-1 size-1]);
    %CPP=NaN
    %CPP=amatic(M,CPP);  %svd_u_v
CS=dlmread ([file '_cs' velikost '.csv'],';',[0 0 size-1 size-1]);
    %CS=amatic(M,CS);    %svd_u_v
J=dlmread ([file '_j' velikost '.csv'],';',[0 0 size-1 size-1]);
    %J=amatic(M,J);      %svd_u_v


rv(1)=max(max(M-CPP));
rv(2)=max(max(M-J));
rv(3)=max(max(M-CS));

n1(1)=norm(M-CPP,1);
n1(2)=norm(M-J,1);
n1(3)=norm(M-CS,1);

n2(1)=norm(M-CPP,2);
n2(2)=norm(M-J,2);
n2(3)=norm(M-CS,2);

ni(1)=norm(M-CPP,'inf');
ni(2)=norm(M-J,'inf');
ni(3)=norm(M-CS,'inf');

nf(1)=norm(M-CPP,'fro');
nf(2)=norm(M-J,'fro');
nf(3)=norm(M-CS,'fro');

file
%sprintf('           M-C++           M-J           M-C#')
sprintf('M-c++:     M-J:     M-c#: \n %0.5g       %0.5g    %0.5g',rv(1),rv(2),rv(3));
sprintf('M-c++:     M-J:     M-c#: \n %0.5g       %0.5g    %0.5g',n1(1),n1(2),n1(3));
sprintf('M-c++:     M-J:     M-c#: \n %0.5g       %0.5g    %0.5g',n2(1),n2(2),n2(3));
sprintf('M-c++:     M-J:     M-c#: \n %0.5g       %0.5g    %0.5g',ni(1),ni(2),ni(3));
sprintf('M-c++:     M-J:     M-c#: \n %0.5g       %0.5g    %0.5g',nf(1),nf(2),nf(3));
%rv
vektory=[rv;n1;n2;ni;nf]

out=[rv(1) nf(1) rv(2) nf(2) rv(3) nf(3)]

cd vysledky
man=sprintf('%s%s',file,'.csv');
DLMWRITE(man,out,'delimiter',';','newline','pc','precision','%.20f');

cd(wd);